package cn.mooncode.basketballManage.mapper;

import cn.mooncode.basketballManage.pojo.Train;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jwz
 * @since 2021-03-28
 */
public interface TrainMapper extends BaseMapper<Train> {

    /**
     * 获取所有训练信息
     * @param page
     * @param currentPage
     * @param size
     * @return
     */
    IPage<Train> getAllTrains(Page<Train> page, Integer currentPage, Integer size);

    /**
     * 获取当前用户所有训练信息
     * @param page
     * @param currentPage
     * @param size
     * @param tid
     * @return
     */
    IPage<Train> getCurrentTrains(Page<Train> page, Integer currentPage, Integer size, Integer tid);

    /**
     * 添加训练结果
     * @param id
     * @param result
     * @return
     */
    boolean addResult(Integer id, String result);
}
